package top.mcwebsite.playandroid.business.login.impl.vm

import top.mcwebsite.playandroid.lib.mvi.base.IIntent
import top.mcwebsite.playandroid.lib.mvi.base.IUiEffect
import top.mcwebsite.playandroid.lib.mvi.base.IUiState

sealed interface LoginIntent : IIntent {
    data object RequestLoginIntent : LoginIntent
    data object GoRegisterIntent: LoginIntent
    data object RequestForgetPasswordIntent: LoginIntent
    class OnInputUsernameIntent(val username: String) : LoginIntent
    class OnInputPasswordIntent(val password: String) : LoginIntent
}

sealed interface LoginUiEffect : IUiEffect {
    object GoForgetPasswordEffect : LoginUiEffect
    object GoRegisterEffect : LoginUiEffect

    object LoginSuccessEffect : LoginUiEffect
}

data class LoginUiState(
    val username: String = "",
    val password: String = "",
    val isCanClickLoginButton: Boolean = false,
    val toastMessage: String? = null,
) : IUiState